// 自动注入到根路由

import {
  KRouteCluster,
  KRouteConfigMap,
  KRouteDaemonSet,
  KRouteDeployment,
  KRouteIngress,
  KRouteLoadbalance,
  KRouteNamespace,
  KRouteNode,
  KRoutePod,
  KRoutePV,
  KRoutePVC,
  KRouteSecret,
  KRouteService,
  KRouteStatefulSet,
  KRouteStorage,
  KRouteWorkflow,
  KRouteWorkload
} from ".";

const Layout = () => import("@/layout/index.vue");

export default [
  {
    ...KRouteWorkflow.Layout,
    component: "Layout",
    meta: { title: "工作流", icon: "ep:link" },
    children: [
      {
        ...KRouteWorkflow.List,
        meta: { title: "工作流", icon: "ep:link" }
      }
    ]
  },
  {
    ...KRouteWorkload.Layout,
    component: "Layout",
    meta: { title: "应用负载", icon: "ep:box" },
    children: [
      {
        ...KRouteDeployment.List,
        meta: { title: "Deployment", icon: "ep:box" }
      },
      {
        ...KRouteDeployment.Create,
        meta: { title: "DeploymentCreate", icon: "ep:box" },
        hidden: true
      },
      {
        ...KRouteDeployment.Details,
        meta: { title: "DeploymentDetails", icon: "ep:box" },
        hidden: true
      },
      {
        ...KRoutePod.List,
        meta: { title: "Pod", icon: "ep:message" }
      },
      {
        ...KRoutePod.Details,
        hidden: true,
        meta: { title: "Pod详情", icon: "ep:message" }
      },
      {
        ...KRouteDaemonSet.List,
        meta: { title: "DaemonSet", icon: "ep:message" }
      },
      {
        ...KRouteDaemonSet.Details,
        meta: { title: "DaemonSetDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteStatefulSet.List,
        meta: { title: "StatefulSets", icon: "ep:message" }
      },
      {
        ...KRouteStatefulSet.Details,
        meta: { title: "StatefulSetsDetails", icon: "ep:message" },
        hidden: true
      }
    ]
  },
  {
    ...KRouteLoadbalance.Layout,
    component: Layout,
    meta: { title: "负载均衡", icon: "ep:message" },
    children: [
      {
        ...KRouteService.List,
        meta: { title: "Service", icon: "ep:message" }
      },
      {
        ...KRouteService.Details,
        meta: { title: "ServiceDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteService.Create,
        meta: { title: "ServiceCreate", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteService.Edit,
        meta: { title: "ServiceEdit", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteIngress.List,
        meta: { title: "Ingresses", icon: "ep:message" }
      },
      {
        ...KRouteIngress.Details,
        meta: { title: "IngressDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteIngress.Operate,
        meta: { title: "IngressOperate", icon: "ep:message" },
        hidden: true
      }
    ]
  },
  {
    ...KRouteStorage.Layout,
    component: Layout,
    meta: { title: "存储与配置", icon: "ep:message" },
    children: [
      {
        ...KRouteConfigMap.List,
        meta: { title: "ConfigMap", icon: "ep:message" }
      },
      {
        ...KRouteConfigMap.Create,
        meta: { title: "ConfigMapCreate", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteConfigMap.Details,
        meta: { title: "ConfigMapDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteConfigMap.Edit,
        meta: { title: "ConfigMapEdit", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteSecret.List,
        meta: { title: "Secret", icon: "ep:message" }
      },

      {
        ...KRouteSecret.Create,
        meta: { title: "SecretCreate", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRouteSecret.Details,
        meta: { title: "SecretDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRoutePVC.List,
        meta: { title: "PVC", icon: "ep:message" }
      },
      {
        ...KRoutePVC.Details,
        meta: { title: "PVCDetails", icon: "ep:message" },
        hidden: true
      },
      {
        ...KRoutePVC.Create,
        meta: { title: "PVCCreate", icon: "ep:message" },
        hidden: true
      }
    ]
  },
  {
    ...KRouteCluster.Layout,
    component: Layout,
    meta: { title: "集群", icon: "ep:list", rank: 2 },
    children: [
      {
        ...KRouteCluster.List,
        meta: { title: "Cluster", icon: "ep:monitor" }
      },
      {
        ...KRouteNode.List,
        meta: { title: "Node", icon: "ep:monitor" }
      },
      {
        ...KRouteNode.Details,
        meta: { title: "NodeDetails", icon: "ep:monitor" },
        hidden: true
      },
      {
        ...KRouteNamespace.List,
        meta: { title: "Namespace", icon: "ep:cellphone" }
      },

      {
        ...KRouteNamespace.Create,
        meta: { title: "Namespace", icon: "ep:cellphone" }
      },

      {
        ...KRouteNamespace.Details,
        meta: { title: "NamespaceDetails", icon: "ep:cellphone" },
        hidden: true
      },
      {
        ...KRoutePV.List,
        meta: { title: "PV", icon: "ep:coffee" }
      },
      {
        ...KRoutePV.Details,
        meta: { title: "PVDetails", icon: "ep:coffee" },
        hidden: true
      }
    ]
  }
];
